﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>优惠券菜单查询</title>
<link href="css/together.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="StyleSheet" media="all" href="${ctx}/css/combined.css">
<link type="text/css" rel="StyleSheet" media="all" href="${ctx}/css/global.css">
<script type="text/javascript" src="${ctx}/js/calendar.js"></script>
<script type="text/javascript" src="${ctx}/js/calendar-zh.js"></script>
<script type="text/javascript" src="${ctx}/js/calendar-setup.js"></script>
<script type="text/javascript">
    // Hack to avoid bug in jscalendar - JRA-7713
    if (!Calendar._TT["WEEKEND"]) Calendar._TT["WEEKEND"] = "0,6";
    if (!Calendar._TT["DAY_FIRST"]) Calendar._TT["DAY_FIRST"] = "Display %s first";
</script>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
<script language="javascript">  
	window.onload=function(){
       var addButton = document.getElementById("addButton");
       
       addButton.onclick=function(){
           document.getElementById("itsMethod").value = "toAdd";
           document.getElementsByTagName("form")[0].submit();
       }
    }
    
	function gotoPage(pageOffset, pageSize) {
			var form = document.getElementsByTagName("form")[0];
			form.elements["pager.offset"].value = pageOffset;
			form.elements["pageSize"].value = pageSize;
			form.submit();
	}
</script>
</head>

<body>
<form action="${ctx}/ecoupon.do" method="post">
<input type="hidden" id="itsMethod" name="method" value="toquery"/>
<table align="center" width="98%">
	<tr>
    	<th colspan="4" height="25px">礼券修改管理</th>
    </tr>
    <tr>
    	<td class="td_01">优惠名称：</td>
        <td class="td_04">
            <input type="text" name="ecoupon.name" value="${ecoupon.name}" size="20px" id="textfield" />&nbsp;&nbsp;<span class="STYLE1">模糊查询</span></td>
        <td class="td_01">优惠券代码：</td>
        <td class="td_04"><input type="text" name="ecoupon.lagoidStr" value="${ecoupon.lagoidStr}" size="20px" id="textfield" />        </td>
    </tr>
     <tr>
    	<td class="td_01">状态：</td>
        <td class="td_04">
        <select name="ecoupon.struts" id="select">
          <option value="-1">--ALL--</option>
		  <logic:equal name="ecoupon" property="struts" value="0">
					<option value="0" selected="selected">有效</option>
		  </logic:equal>
		  <logic:notEqual name="ecoupon" property="struts" value="0">
					<option value="0">有效</option>
		  </logic:notEqual>
		  <logic:equal name="ecoupon" property="struts" value="1">
					<option value="1" selected="selected">无效</option>
		  </logic:equal>
		  <logic:notEqual name="ecoupon" property="struts" value="1">
					<option value="1">无效</option>
		  </logic:notEqual>
        </select>        
        </td>
        <td class="td_01">创建时间：</td>
        <td class="td_04">
        	<input name="ecoupon.addtimeStr" id="created:after" value="${ecoupon.addtimeStr}"  type="text" / style="background-image:url(${ctx}/images/cal.gif); background-repeat:no-repeat; background-position:left;padding-left:25px; cursor:hand;width:176px"> 
			<script type="text/javascript">
		    	Calendar.setup({
		
		        firstDay       :    0,                  // first day of the week
		        inputField     :    "created:after",     // id of the input field
		        button         :    "created:after_trigger_c",  // trigger for the calendar (button ID)
		        align          :    "Bl",           // alignment (defaults to "Bl")
		        singleClick    :    true,
		             ifFormat       : "%y/%m/%d"      // our date only format
		         });
            </script>
        </td>
    </tr>
     <tr>
    	<td colspan="4" align="center">
        <input type="submit"  class="btn" value="查询" />
        </td>
    </tr>
</table>
<div style=" width:98%; padding:5px 0px 5px 0px">&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="button" id="addButton" class="btn" value="新优惠券"/>
</div>
<logic:notEmpty name="ecouponList" property="records">
<table align="center" width="98%">
    <tr>
    	<th class="td_01" height="25px" nowrap>优惠卷代码</th>
      	<th class="td_01">优惠卷名称</th>
      	<th class="td_01" nowrap>生效日期</th>
      	<th class="td_01" nowrap>失效日期</th>
      	<th class="td_01" nowrap>状态</th>
      	<th class="td_01" nowrap>创建人&nbsp;/&nbsp;日期</th>
      	<th class="td_01" nowrap>修改</th>
   </tr>
   <logic:iterate id="list" name="ecouponList" property="records">
	   <tr>
	    	<td class="td_03" nowrap>${list.lagoid}</td>
	        <td class="td_03">${list.name}</td>
	      	<td class="td_03" nowrap><bean:write name="list" property="startime" format="yyyy-MM-dd"/></td>
	      	<td class="td_03" nowrap><bean:write name="list" property="endtime" format="yyyy-MM-dd"/></td>
	      	<td class="td_03" nowrap>
	      		<logic:equal name="list" property="struts" value="0">
					有效
			    </logic:equal>
				<logic:notEqual name="list" property="struts" value="0">
					无效
			    </logic:notEqual>
	      	</td>
	        <td class="td_03">${list.userName}&nbsp;/&nbsp;<bean:write name="list" property="addtime" format="yyyy-MM-dd"/></td>
	        <td class="td_03">
	        	<logic:equal value="4" name="list" property="mark">
	        		<a href="${ctx}/ecoupon.do?method=toUpdate&ecouponno=${list.ecouponno}&ecouponno1=${list.lagoid}">编辑</a>
	        	</logic:equal>
	        	<logic:notEqual value="4" name="list" property="mark">
	        		<logic:equal value="0" name="list" property="provide">
	        			<a href="${ctx}/ecoupon.do?method=toUpdate&ecouponno=${list.ecouponno}&ecouponno1=${list.lagoid}">编辑</a>
	        		</logic:equal>
	        		<logic:notEqual value="0" name="list" property="provide">
	        			不可编辑
	        		</logic:notEqual>
	        	</logic:notEqual>
	        </td>
	  </tr>
  </logic:iterate>
  <tr>
  	<td align="right" colspan="7"><%@ include file="/pages/safeai/jsp/common/page.jsp"%></td>
  </tr>
</table>
</logic:notEmpty>
</form>
</body>
</html>
